Skip to content

Conversation

jeffgbutler
Copy link
Member

Conditions can now override the "renderCondition" method to change how the condition is rendered.

This change makes it possible to alter the rendering of conditions. Previously, the rendering algorithm was hard-coded into a visitor and could not be altered easily. With this change, we retain the default behavior from before but also allow custom conditions to override the default behavior.

This change also renames the "VisitableCondition" interface to "RenderableCondition" because conditions are no longer rendered via a visitor. The prior name is kept and deprecated for now to provide some assistance for code migration in the event anyone has created a direct implementation of VisitableCondition. Custom conditions that extend one of the abstract base classes (AbstractSingleValueCondition. etc.) should have no changes required.

Resolves #916

Conditions are no longer rendered via a Visitor, so the new name makes more sense
Conditions are no longer rendered via a Visitor, so the new name makes more sense
@jeffgbutler jeffgbutler added this to the 2.0.0 milestone Mar 6, 2025
@jeffgbutler jeffgbutler merged commit eeedb40 into mybatis:master Mar 6, 2025
7 checks passed
@jeffgbutler jeffgbutler deleted the condition-rendering branch March 6, 2025 14:53
@coveralls
Copy link

Coverage Status

coverage: 100.0%. remained the same
when pulling 13fb0cf on jeffgbutler:condition-rendering
into 978152d on mybatis:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to use 'ESCAPE' in DynamicSQL ?

2 participants